package com.ruoyi.finance.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 支付订单对象 pay_order
 * @author zt
 * @date 2023-11-15
 */
public class PayOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 付费账户 */
    @Excel(name = "付费账户")
    private String account;

    /** $column.columnComment */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String openid;

    /** 本侧商户订单号 */
    private String outTradeNo;

    /** 微信支付订单号/支付宝交易号(凭证号) */
    @Excel(name = "微信支付订单号/支付宝交易号(凭证号)")
    private String transactionId;

    /** 支付产品名 */
    @Excel(name = "支付产品名")
    private String body;

    /** 总价 */
    @Excel(name = "总价")
    private BigDecimal totalFee;

    /** SUCCESS--支付成功
     REFUND--转入退款
     NOTPAY--未支付
     CLOSED--已关闭
     REVOKED--已撤销(刷卡支付)
     USERPAYING--用户支付中
     PAYERROR--支付失败(其他原因，如银行返回失败)
     ACCEPT--已接收，等待扣款 */
    @Excel(name = "SUCCESS--支付成功 REFUND--转入退款  NOTPAY--未支付  CLOSED--已关闭 REVOKED--已撤销(刷卡支付)  USERPAYING--用户支付中  PAYERROR--支付失败(其他原因，如银行返回失败)  ACCEPT--已接收，等待扣款")
    private String tradeState;

    /**  */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date payTime;

    /**  */
    @Excel(name = "")
    private String moreInfo;

    /** 1：weiChatPay   2：aliPay  3：ohter */
    @Excel(name = "1：weiChatPay   2：aliPay  3：ohter")
    private String payType;

    public PayOrder(String outTradeNo,String openid, String transactionId, String tradeState, Date payTime) {
        this.outTradeNo = outTradeNo;
        this.openid = openid;
        this.transactionId = transactionId;
        this.tradeState = tradeState;
        this.payTime = payTime;
    }

    public PayOrder() {
    }

    public void setAccount(String account)
    {
        this.account = account;
    }

    public String getAccount()
    {
        return account;
    }
    public void setOpenid(String openid)
    {
        this.openid = openid;
    }

    public String getOpenid()
    {
        return openid;
    }
    public void setOutTradeNo(String outTradeNo)
    {
        this.outTradeNo = outTradeNo;
    }

    public String getOutTradeNo()
    {
        return outTradeNo;
    }
    public void setTransactionId(String transactionId)
    {
        this.transactionId = transactionId;
    }

    public String getTransactionId()
    {
        return transactionId;
    }

    public void setBody(String body)
    {
        this.body = body;
    }

    public String getBody()
    {
        return body;
    }
    public void setTotalFee(BigDecimal totalFee)
    {
        this.totalFee = totalFee;
    }

    public BigDecimal getTotalFee()
    {
        return totalFee;
    }
    public void setTradeState(String tradeState)
    {
        this.tradeState = tradeState;
    }

    public String getTradeState()
    {
        return tradeState;
    }
    public void setPayTime(Date payTime)
    {
        this.payTime = payTime;
    }

    public Date getPayTime()
    {
        return payTime;
    }
    public void setMoreInfo(String moreInfo)
    {
        this.moreInfo = moreInfo;
    }

    public String getMoreInfo()
    {
        return moreInfo;
    }
    public void setPayType(String payType)
    {
        this.payType = payType;
    }

    public String getPayType()
    {
        return payType;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("account", getAccount())
                .append("openid", getOpenid())
                .append("outTradeNo", getOutTradeNo())
                .append("transactionId", getTransactionId())
                .append("body", getBody())
                .append("totalFee", getTotalFee())
                .append("tradeState", getTradeState())
                .append("createTime", getCreateTime())
                .append("payTime", getPayTime())
                .append("moreInfo", getMoreInfo())
                .append("payType", getPayType())
                .toString();
    }

}
